package io.renren.enums;

import java.util.ArrayList;
import java.util.List;

public enum ScheduleTypeEnum {
    Automatic("Automatic"),
    Uniform("Uniform"),
    Karras("Karras"),
    Exponential("Exponential"),
    Polyexponential("Polyexponential"),
    SGM_Uniform("SGM_Uniform");

    private String name;

    ScheduleTypeEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static ScheduleTypeEnum getEnumByName(String name) {
        for (ScheduleTypeEnum scheduleTypeEnum : ScheduleTypeEnum.values()) {
            if (scheduleTypeEnum.getName().equals(name)) {
                return scheduleTypeEnum;
            }
        }
        return null;
    }

    public static String getNameByEnum(ScheduleTypeEnum scheduleTypeEnum) {
        return scheduleTypeEnum.getName();
    }

    public static List<String> getAllName() {
        List<String> names = new ArrayList<>();
        for (ScheduleTypeEnum scheduleTypeEnum : ScheduleTypeEnum.values()) {
            names.add(scheduleTypeEnum.getName());
        }
        return names;
    }
}
